package stark.app.function.selectmedia;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;
import com.stark.picselect.entity.SelectMediaEntity;

import org.jetbrains.annotations.NotNull;

import stark.app.BR;
import stark.app.R;
import stark.app.databinding.ItemSelectMediaBinding;
import stark.common.basic.adapter.BaseDBRVAdapter;

/**
 * Author：daizhongbin on 2021/3/16
 * Email：1027154338@qq.com
 * Desc:
 */
public class SelectMediaAdapter extends BaseDBRVAdapter<SelectMediaEntity, ItemSelectMediaBinding> {

    public SelectMediaAdapter() {
        super(R.layout.item_select_media, BR.selectMedia);
    }

    @Override
    protected void convert(@NotNull BaseDataBindingHolder<ItemSelectMediaBinding> holder, SelectMediaEntity selectMediaEntity) {
        ItemSelectMediaBinding binding = holder.getDataBinding();
        Glide.with(binding.ivImage).load(selectMediaEntity.getTargetPath()).into(binding.ivImage);
    }
}
